package com.cc.gulimall.product;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

/**
 * 整合MyBatis-Plus
 * 1）导入依赖
 *            <dependency>
 *             <groupId>com.baomidou</groupId>
 *             <artifactId>mybatis-plus-boot-starter</artifactId>
 *             <version>3.3.1</version>
 *            </dependency>
 * 2) 配置
 *      1.配置数据源：
 *          1）导入数据库驱动
 *          <dependency>
 *             <groupId>mysql</groupId>
 *             <artifactId>mysql-connector-java</artifactId>
 *             <version>8.0.22</version>
 *          </dependency>
 *          2）创建application.yml文件 配置相关信息 配置数据源信息
 *          spring:
 *              datasource:
 *                username: root
 *                password: root
 *                url: jdbc:mysql://192.168.56.10:3306/gulimall_pms
 *                driver-class-name: com.mysql.jdbc.Driver
 *      2.配置MyBatis-Plus
 *          1）使用@MapperScan 后面跟上dao层的位置 （copy path ->copy reference）
 *          2）告诉MyBatis-Plus，sql映射文件位置，在application.yml文件中配置
 *
 */
@MapperScan("com.cc.gulimall.product.dao")
@SpringBootApplication
@EnableDiscoveryClient
public class GulimallProductApplication {

    public static void main(String[] args) {
        SpringApplication.run(GulimallProductApplication.class, args);
    }

}
